\(\int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx\) [79]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 108 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \]

[Out]

3/8*(a^2+b^2)^2*x-3/8*(a^2+b^2)*(b*cos(d*x+c)-a*sin(d*x+c))*(a*cos(d*x+c)+b*sin(d*x+c))/d-1/4*(b*cos(d*x+c)-a*
sin(d*x+c))*(a*cos(d*x+c)+b*sin(d*x+c))^3/d

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3152, 8} \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}+\frac {3}{8} x \left (a^2+b^2\right )^2-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \]

[In]

Int[(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]

[Out]

(3*(a^2 + b^2)^2*x)/8 - (3*(a^2 + b^2)*(b*Cos[c + d*x] - a*Sin[c + d*x])*(a*Cos[c + d*x] + b*Sin[c + d*x]))/(8
*d) - ((b*Cos[c + d*x] - a*Sin[c + d*x])*(a*Cos[c + d*x] + b*Sin[c + d*x])^3)/(4*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3152

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-(b*Cos[c + d*x]
- a*Sin[c + d*x]))*((a*Cos[c + d*x] + b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Dist[(n - 1)*((a^2 + b^2)/n), Int[(
a*Cos[c + d*x] + b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] &&  !IntegerQ[
(n - 1)/2] && GtQ[n, 1]

Rubi steps \begin{align*} \text {integral}& = -\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{4} \left (3 \left (a^2+b^2\right )\right ) \int (a \cos (c+d x)+b \sin (c+d x))^2 \, dx \\ & = -\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{8} \left (3 \left (a^2+b^2\right )^2\right ) \int 1 \, dx \\ & = \frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.11 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.99 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {12 \left (a^2+b^2\right )^2 (c+d x)-16 a b \left (a^2+b^2\right ) \cos (2 (c+d x))-4 a b \left (a^2-b^2\right ) \cos (4 (c+d x))+8 \left (a^4-b^4\right ) \sin (2 (c+d x))+\left (a^4-6 a^2 b^2+b^4\right ) \sin (4 (c+d x))}{32 d} \]

[In]

Integrate[(a*Cos[c + d*x] + b*Sin[c + d*x])^4,x]

[Out]

(12*(a^2 + b^2)^2*(c + d*x) - 16*a*b*(a^2 + b^2)*Cos[2*(c + d*x)] - 4*a*b*(a^2 - b^2)*Cos[4*(c + d*x)] + 8*(a^
4 - b^4)*Sin[2*(c + d*x)] + (a^4 - 6*a^2*b^2 + b^4)*Sin[4*(c + d*x)])/(32*d)

Maple [A] (verified)

Time = 1.05 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.25

method result size
parallelrisch \(\frac {\left (a^{4}-6 a^{2} b^{2}+b^{4}\right ) \sin \left (4 d x +4 c \right )+16 \left (-a^{3} b -a \,b^{3}\right ) \cos \left (2 d x +2 c \right )+4 \left (-a^{3} b +a \,b^{3}\right ) \cos \left (4 d x +4 c \right )+8 \left (a^{4}-b^{4}\right ) \sin \left (2 d x +2 c \right )+12 a^{4} d x +24 a^{2} b^{2} d x +12 b^{4} d x +20 a^{3} b +12 a \,b^{3}}{32 d}\) \(135\)
derivativedivides \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )-a^{3} b \cos \left (d x +c \right )^{4}+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \,b^{3} \sin \left (d x +c \right )^{4}+b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(153\)
default \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )-a^{3} b \cos \left (d x +c \right )^{4}+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )+a \,b^{3} \sin \left (d x +c \right )^{4}+b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) \(153\)
parts \(\frac {a^{4} \left (\frac {\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {b^{4} \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {a \,b^{3} \sin \left (d x +c \right )^{4}}{d}+\frac {6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}-\frac {a^{3} b \cos \left (d x +c \right )^{4}}{d}\) \(164\)
risch \(\frac {3 a^{4} x}{8}+\frac {3 a^{2} b^{2} x}{4}+\frac {3 b^{4} x}{8}-\frac {a^{3} b \cos \left (4 d x +4 c \right )}{8 d}+\frac {a \,b^{3} \cos \left (4 d x +4 c \right )}{8 d}+\frac {\sin \left (4 d x +4 c \right ) a^{4}}{32 d}-\frac {3 \sin \left (4 d x +4 c \right ) a^{2} b^{2}}{16 d}+\frac {\sin \left (4 d x +4 c \right ) b^{4}}{32 d}-\frac {a^{3} b \cos \left (2 d x +2 c \right )}{2 d}-\frac {a \,b^{3} \cos \left (2 d x +2 c \right )}{2 d}+\frac {a^{4} \sin \left (2 d x +2 c \right )}{4 d}-\frac {\sin \left (2 d x +2 c \right ) b^{4}}{4 d}\) \(183\)
norman \(\frac {\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x +\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {9}{4} a^{4}+\frac {9}{2} a^{2} b^{2}+\frac {9}{4} b^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {16 a \,b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {8 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}+\frac {8 a^{3} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{d}-\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{4 d}+\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}\) \(365\)

[In]

int((cos(d*x+c)*a+b*sin(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/32*((a^4-6*a^2*b^2+b^4)*sin(4*d*x+4*c)+16*(-a^3*b-a*b^3)*cos(2*d*x+2*c)+4*(-a^3*b+a*b^3)*cos(4*d*x+4*c)+8*(a
^4-b^4)*sin(2*d*x+2*c)+12*a^4*d*x+24*a^2*b^2*d*x+12*b^4*d*x+20*a^3*b+12*a*b^3)/d

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.12 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {16 \, a b^{3} \cos \left (d x + c\right )^{2} + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{4} - 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x - {\left (2 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a^{4} + 6 \, a^{2} b^{2} - 5 \, b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/8*(16*a*b^3*cos(d*x + c)^2 + 8*(a^3*b - a*b^3)*cos(d*x + c)^4 - 3*(a^4 + 2*a^2*b^2 + b^4)*d*x - (2*(a^4 - 6
*a^2*b^2 + b^4)*cos(d*x + c)^3 + (3*a^4 + 6*a^2*b^2 - 5*b^4)*cos(d*x + c))*sin(d*x + c))/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 381 vs. \(2 (102) = 204\).

Time = 0.21 (sec) , antiderivative size = 381, normalized size of antiderivative = 3.53 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\begin {cases} \frac {3 a^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{4} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {a^{3} b \cos ^{4}{\left (c + d x \right )}}{d} + \frac {3 a^{2} b^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {a b^{3} \sin ^{4}{\left (c + d x \right )}}{d} + \frac {3 b^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{4} x \cos ^{4}{\left (c + d x \right )}}{8} - \frac {5 b^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 b^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \]

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))**4,x)

[Out]

Piecewise((3*a**4*x*sin(c + d*x)**4/8 + 3*a**4*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*a**4*x*cos(c + d*x)**4/
8 + 3*a**4*sin(c + d*x)**3*cos(c + d*x)/(8*d) + 5*a**4*sin(c + d*x)*cos(c + d*x)**3/(8*d) - a**3*b*cos(c + d*x
)**4/d + 3*a**2*b**2*x*sin(c + d*x)**4/4 + 3*a**2*b**2*x*sin(c + d*x)**2*cos(c + d*x)**2/2 + 3*a**2*b**2*x*cos
(c + d*x)**4/4 + 3*a**2*b**2*sin(c + d*x)**3*cos(c + d*x)/(4*d) - 3*a**2*b**2*sin(c + d*x)*cos(c + d*x)**3/(4*
d) + a*b**3*sin(c + d*x)**4/d + 3*b**4*x*sin(c + d*x)**4/8 + 3*b**4*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*b*
*4*x*cos(c + d*x)**4/8 - 5*b**4*sin(c + d*x)**3*cos(c + d*x)/(8*d) - 3*b**4*sin(c + d*x)*cos(c + d*x)**3/(8*d)
, Ne(d, 0)), (x*(a*cos(c) + b*sin(c))**4, True))

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.26 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=-\frac {a^{3} b \cos \left (d x + c\right )^{4}}{d} + \frac {a b^{3} \sin \left (d x + c\right )^{4}}{d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4}}{32 \, d} + \frac {3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} b^{2}}{16 \, d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{4}}{32 \, d} \]

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="maxima")

[Out]

-a^3*b*cos(d*x + c)^4/d + a*b^3*sin(d*x + c)^4/d + 1/32*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c)
)*a^4/d + 3/16*(4*d*x + 4*c - sin(4*d*x + 4*c))*a^2*b^2/d + 1/32*(12*d*x + 12*c + sin(4*d*x + 4*c) - 8*sin(2*d
*x + 2*c))*b^4/d

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.13 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3}{8} \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} x - \frac {{\left (a^{3} b - a b^{3}\right )} \cos \left (4 \, d x + 4 \, c\right )}{8 \, d} - \frac {{\left (a^{3} b + a b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (a^{4} - b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \]

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^4,x, algorithm="giac")

[Out]

3/8*(a^4 + 2*a^2*b^2 + b^4)*x - 1/8*(a^3*b - a*b^3)*cos(4*d*x + 4*c)/d - 1/2*(a^3*b + a*b^3)*cos(2*d*x + 2*c)/
d + 1/32*(a^4 - 6*a^2*b^2 + b^4)*sin(4*d*x + 4*c)/d + 1/4*(a^4 - b^4)*sin(2*d*x + 2*c)/d

Mupad [B] (verification not implemented)

Time = 24.14 (sec) , antiderivative size = 320, normalized size of antiderivative = 2.96 \[ \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx=\frac {3\,\mathrm {atan}\left (\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,\left (\frac {3\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )}\right )\,{\left (a^2+b^2\right )}^2}{4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,d} \]

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^4,x)

[Out]

(3*atan((3*tan(c/2 + (d*x)/2)*(a^2 + b^2)^2)/(4*((3*a^4)/4 + (3*b^4)/4 + (3*a^2*b^2)/2)))*(a^2 + b^2)^2)/(4*d)
 + (tan(c/2 + (d*x)/2)^7*((3*b^4)/4 - (5*a^4)/4 + (3*a^2*b^2)/2) - tan(c/2 + (d*x)/2)^3*((3*a^4)/4 + (11*b^4)/
4 - (21*a^2*b^2)/2) + tan(c/2 + (d*x)/2)^5*((3*a^4)/4 + (11*b^4)/4 - (21*a^2*b^2)/2) - tan(c/2 + (d*x)/2)*((3*
b^4)/4 - (5*a^4)/4 + (3*a^2*b^2)/2) + 8*a^3*b*tan(c/2 + (d*x)/2)^2 + 16*a*b^3*tan(c/2 + (d*x)/2)^4 + 8*a^3*b*t
an(c/2 + (d*x)/2)^6)/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*tan(c/2 + (d*x)/2)^4 + 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 +
(d*x)/2)^8 + 1)) - (3*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2)*(a^2 + b^2)^2)/(4*d)